package com.avic.modules.equipment.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.avic.modules.equipment.domain.vo.Category;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author zhangzikang 设备类别表
 * @date 2022-08-14
 */
@Data
@TableName("equipment_category")
@NoArgsConstructor
public class EquipmentCategory implements Serializable {

    @TableId(value="ID", type = IdType.AUTO)
    private Long id;

    // 名称
    private String name;

    // 英文名称
    private String englishName;

    @TableField(exist = false)
    private Integer cardType;

    /** 详情 */
    @TableField(exist = false)
    private Category category;

    public void copy(EquipmentCategory source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
